package com.ruoyi.service.impl;

import java.util.List;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.mapper.SysMaterialPlanMapper;
import com.ruoyi.domain.SysMaterialPlan;
import com.ruoyi.service.ISysMaterialPlanService;
import com.ruoyi.common.core.text.Convert;

/**
 * 预算材料总计划Service业务层处理
 * 
 * @author ruoyi
 * @date 2020-07-08
 */
@Service
public class SysMaterialPlanServiceImpl implements ISysMaterialPlanService 
{
    @Autowired
    private SysMaterialPlanMapper sysMaterialPlanMapper;

    /**
     * 查询预算材料总计划
     * 
     * @param matId 预算材料总计划ID
     * @return 预算材料总计划
     */
    @Override
    public SysMaterialPlan selectSysMaterialPlanById(Integer matId)
    {
        return sysMaterialPlanMapper.selectSysMaterialPlanById(matId);
    }

    /**
     * 查询预算材料总计划列表
     * 
     * @param sysMaterialPlan 预算材料总计划
     * @return 预算材料总计划
     */
    @Override
    public List<SysMaterialPlan> selectSysMaterialPlanList(SysMaterialPlan sysMaterialPlan)
    {
        return sysMaterialPlanMapper.selectSysMaterialPlanList(sysMaterialPlan);
    }

    /**
     * 新增预算材料总计划
     * 
     * @param sysMaterialPlan 预算材料总计划
     * @return 结果
     */
    @Override
    public int insertSysMaterialPlan(SysMaterialPlan sysMaterialPlan)
    {
        return sysMaterialPlanMapper.insertSysMaterialPlan(sysMaterialPlan);
    }

    /**
     * 修改预算材料总计划
     * 
     * @param sysMaterialPlan 预算材料总计划
     * @return 结果
     */
    @Override
    public int updateSysMaterialPlan(SysMaterialPlan sysMaterialPlan)
    {
        return sysMaterialPlanMapper.updateSysMaterialPlan(sysMaterialPlan);
    }

    /**
     * 删除预算材料总计划对象
     * 
     * @param ids 需要删除的数据ID
     * @return 结果
     */
    @Override
    public int deleteSysMaterialPlanByIds(String ids)
    {
        return sysMaterialPlanMapper.deleteSysMaterialPlanByIds(Convert.toStrArray(ids));
    }

    /**
     * 删除预算材料总计划信息
     * 
     * @param matId 预算材料总计划ID
     * @return 结果
     */
    @Override
    public int deleteSysMaterialPlanById(Integer matId)
    {
        return sysMaterialPlanMapper.deleteSysMaterialPlanById(matId);
    }
    /**
     * 查询总项目对应的预算材料总计划
     */
    @Override
    public List<SysMaterialPlan> selectMaterialsRequisitionesLists(Long mId) {
        return sysMaterialPlanMapper.selectMaterialsRequisitionesLists(mId);
    }
    /**
     * 查询材料类型
     */
    @Override
    public SysMaterialPlan selectmatType(Long mId, String matType) {
        return sysMaterialPlanMapper.selectmatType(mId,matType);
    }
    /**
     * 查询材料类型
     */
    @Override
    public SysMaterialPlan selectmatClassification(Long mId, String matClassification) {
        return sysMaterialPlanMapper.selectmatClassification(mId,matClassification);
    }
    /**
     * 查询材料分类
     */
    @Override
    public SysMaterialPlan selectmatData(Long mId, String matData) {
        return sysMaterialPlanMapper.selectmatData(mId,matData);
    }
    /**
     * 查询材料详情
     */
    @Override
    public SysMaterialPlan selectmatDetails(Long mId, String matDetails) {
        return sysMaterialPlanMapper.selectmatDetails(mId,matDetails);
    }


    //根据预算材料总计划外键id 查询材料数据名
    @Override
    public List<SysMaterialPlan> selectMatdetails(String matclass) {
        return sysMaterialPlanMapper.selectMatdetails(matclass);
    }

    /**
     * 根据id更新字段
     */
    @Override
    public int updateSysMaterialPlans(long mMolecule, Integer matId,long mId) {
        return sysMaterialPlanMapper.updateSysMaterialPlans(mMolecule,matId,mId);
    }

    @Override
    public List<SysMaterialPlan> selectall(SysMaterialPlan sysMaterialPlan) {
        return sysMaterialPlanMapper.selectall(sysMaterialPlan);
    }
}
